#pragma once

#ifndef EVENT_REGISTRATOR
#define EVENT_REGISTRATOR

#include "EventWrap.h"
#include <list>

namespace cevent {

class EventRegistrator {
private:
	friend class EventController;

	EventRegistrator() : ID(-1){};
	EventRegistrator(long id) : ID(id){};
	EventRegistrator(const EventRegistrator&); // undef
	void operator=(const EventRegistrator&); // undef
	virtual ~EventRegistrator(){
		for each (EventListenerWrap* event in eventsChain)
			delete event;
	};

	static long ID_NEXT;
	const long ID;

	std::list<EventListenerWrap*> eventsChain;
};

}

#endif // EVENT_REGISTRATOR